package com.yumeng.generator;

import com.baomidou.mybatisplus.annotation.DbType;

import java.util.Arrays;

/**
 * mysql demo
 *
 * @author wxd
 * @date 2025/10/17 10:21
 */
class MysqlDemoGenerator extends AbstractGenerator {

    public MysqlDemoGenerator(){
        super(new DbInfo()
                .setDbUrl("jdbc:mysql://localhost:3308/yumeng_next?characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=true")
                //.setDbUrl("jdbc:mysql://localhost:3308/yumeng_next?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true")
                .setDbUsername("root")
                .setDbPassword("wang9527008")
                .setDbType(DbType.MYSQL));
    }

    @Override
    protected boolean getEnableAlias() {
        return false;
    }

    public static void main(String[] args){
        String parentPkgName = "com.yumeng";
        GenInfo genInfo = null;

/*        genInfo = new GenInfo()
                .setModuleName("demo_gen")
                .setBaseEntityType(BaseEntityType.CREATE)
                .setTables(Arrays.asList("demo_user", "dm_role"))
                .setTablePrefixs(Arrays.asList("demo_", "dm_"));*/

        genInfo = new GenInfo()
                .setParentPkgName(parentPkgName)
                .setModuleName("demo_gen")
                .setBaseEntityType(BaseEntityType.CREATE_UPDATE)
                .setTables(Arrays.asList("demo_test"))
                .setTablePrefixes(null);//Arrays.asList("demo_")

        MysqlDemoGenerator gen = new MysqlDemoGenerator();
        gen.doGenerate(genInfo);

    }

}
